<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			p {
				height: 30px;
				line-height: 30px;
				font-size: 12px;
				border: 1px solid black;
			}
			
			p a {
				background: url(img/w.gif) no-repeat 3px center;
				padding-left: 20px;
				display: block;
			}
			/* 选择href属性值中包含text的链接,并添加背景图片text.gif */
			p a[href*=text] {
				background-image: url(img/text.gif);
			}
			/* 选择href属性值中包含pdf的链接,并添加背景图片pdf.gif */
			p a[href*=pdf] {
				background-image: url(img/pdf.gif);
			}
			/* 选择href属性值中包含xls的链接,并添加背景图片xls.gif */
			p a[href*=xls] {
				background-image: url(img/xls.gif);
			}
		</style>
	</head>

	<body>
		<p>
			<a href="http://www.xinyan.com/doc/javascript.html">doc文档</a>
		</p>
		<p>
			<a href="http://www.xinyan.com/text/javascript.html">文本文档</a>
		</p>
		<p>
			<a href="http://www.xinyan.com/pdf/javascript.html">pdf文档</a>
		</p>
		<p>
			<a href="http://www.xinyan.com/xls/javascript.html">xls文档</a>
		</p>
	</body>
</html>